package User

import (
	"OnlineRetailers/models/Admin"
)

type Order struct {
	OrderId   string        `orm:"pk;unique"` //唯一标识
	OrderNo   string        //订单号
	Time      int64         //下单时间
	Addr      string        //地址外键
	Phone     string        //电话
	UserName  string        //收件人
	State     int           `orm:"default(0)"` //1未付款 2待发货 3待收货 4已完成 5已取消 6退货退款
	Money     float32       //总价
	MoneyReal float32       //实际的钱
	Desc      string        //备注
	Real      float32       //优惠的钱
	ExpressId string        //快递公司
	OrderCart []*OrderCart  `orm:"rel(m2m);on_delete(set_null)"`
	Coupon    *Admin.Coupon `orm:"rel(fk)"`
	User      *WXUser       `orm:"rel(fk)"`
	Freight   float32
}

type OrderCart struct {
	OrderCartCartId string                 `orm:"size(60) ;pk;unique"`
	Product         *Admin.ProductDetailed `orm:"rel(fk)"`
	Num             int
}
